package cn.itcast.controller.system;


import cn.itcast.controller.BaseController;
import cn.itcast.domain.system.SysLog;
import cn.itcast.service.system.SysLogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Controller
@RequestMapping("/system/log")
public class SysLogController extends BaseController{

    @Autowired
    private SysLogService sysLogService;

    @RequestMapping(value = "/list",name="系统日志列表")
    public String list(SysLog sysLog, @RequestParam(value = "page",defaultValue = "1") int page,
                                      @RequestParam(value = "pageSize",defaultValue = "5") int pageSize){

        PageInfo result = sysLogService.findByPage(getCompanyId(),page,pageSize);

        request.setAttribute("page",result);

        return "/system/log/log-list";
    }
}
